from django.urls import path, re_path
from . import views
from . import converters

urlpatterns = [
    # path("url路径"，视图函数/视图类，name="路径别名")
    # path("index/",views.index),
    # re_path(r"^info/(?P<参数名1>正则)/(?P<参数名2>正则)……$",views.info1),
    # re_path(r"^info/(?P<id>\d+)\$",views.info),
    re_path(r"^info/(?P<id>\d+)/(?P<page>0[1-9])+$", views.info1),
    re_path(r"^mobile/(?P<mobile>1[3-9]\d{9})$", views.info2),
    # 路由转换器【路径转换器】
    path("info/<int:id>",views.info3),
    path("img/<uuid:img_id>",views.info4),
    # 使用自定义路由转换器
    path("sms/<mob:mobile>",views.info5),
    re_path("^(?P<pk>\d+)\.html$",views.detail1),
    re_path("^(?P<cat>\d+)/(?P<pk>\d+)\.html$",views.detail2),
    re_path("goods/(?P<id>\d+)/", views.index3),
    # re_path(r"goods/(?P<cat_id>\d+)/(?P<attr_id>\d+)/$",views.goods),
    # path("img/",views.img),
    path("rev/<int:num>/",views.inbuild_reverse),
    path("rev/<str:content>/",views.inbuild_reverse2),
    path("rev/<uuid:ustr>/", views.inbuild_reverse3),
    # str会包含uuid的模式，str和uuid同时使用时，str必须写在后面
]
